<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
</head>
<body>

<h2>JavaScript 模板字面量</h2>

<p>模板字面量使用反引号 (``) 来定义一个字符串:</p>

<div id="demo"></div>

<p>Internet Explorer 不支持模板字面量。</p>

<script>
let header = "";
let tags = ["aa","bb","cc"];
let html = `<h1>${header}</h1><ul>`;
for(const x of tags){
    html+=`<li>${x}</li>`;
}
html+=`</ul>`
document.getElementById("demo").innerHTML = html;
</script>

</body>
</html>